Scroll to navigation

std::basic_const_iterator::operator[](3) C++ Standard Libary std::basic_const_iterator::operator[](3)

NAME

std::basic_const_iterator::operator[] - std::basic_const_iterator::operator[]

Synopsis

constexpr std::iter_const_reference_t<Iter> operator[]( difference_type n ) const (since C++23) requires std::random_access_iterator<Iterator>;

Returns a reference to the element at specified relative location.

Parameters

n - position relative to current location

Return value

A reference-to-const to the element at relative location, that is, static_cast<std::iter_const_reference_t<Iter>>(base()[n]).

Example


This section is incomplete
Reason: no example

See also

operator* accesses the pointed-to element operator-> (public member function)

2026.11.10 http://cppreference.com